package com.jcx.ldzj.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class BaseEntity {


    @ApiModelProperty(value = "状态0、失效，1、有效")
    @TableField("state_")
    private Character state;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value="create_time_",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value="update_time_",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "更新人")
    @TableField(value="updataer_",fill = FieldFill.INSERT_UPDATE)
    private String updataer;

    @ApiModelProperty(value = "创建人")
    @TableField(value="creatar_",fill = FieldFill.INSERT)
    private String creatar;

    @Override
    public String toString() {
        return "BaseEntity{" +
                ", state=" + state +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", updataer='" + updataer + '\'' +
                ", creatar='" + creatar + '\'' +
                '}';
    }
}
